@extends('default.mobile.layouts.indexPublic')
@section('title','个人账号绑定')
{{--首页css--}}
@section('headcss')
    @parent
    <link rel="stylesheet" href="{{asset('/default/css/mobile/index/register_login.css')}}">
@endsection
{{--头部标签--}}
@section('tag','个人账号绑定')

{{--主体内容--}}
@section('content')
        <!-- E 头部 -->
    <div class="main">
        <ul class="menu">
            <li class="on">账号绑定</li>
            @if(empty($formUrl))
                <li>手机号绑定</li>
            @endif
        </ul>
        {{--普通登录--}}
        <div class="register_login oLogin">
            <form action="{{ empty($formUrl) ? url('mobile/personal/stroybinding') : $formUrl }}" onsubmit="return checkPersonalByWeiChat('#personalForm')" method="post" id="personalForm"  name="personalForm" >
                {{csrf_field()}}
                <input type="hidden" name="unionid" id="unionid" value="{{ $unionid }}">
                <input type="hidden" name="openid" id="openid" value="{{ $openid }}">
                <input type="hidden" name="category" id="category" value="{{ $category }}">
                <ul>
                    <li><i class="icon_rl06"></i><input type="text" name="username" id="username" autocomplete="off"  placeholder="请输入用户名/手机号码"></li>
                    <li><i class="icon_rl07"></i><input type="password" name="password" id="password" placeholder="请输入密码"></li>
                </ul>
                <div class="forget">
                    <span>
                        <input name="remember" type="checkbox" class="agree" id="remember">
                        <label for="remember">记住密码</label>
                    </span>
                    <span class="forgetPass"><a href="{{url('mobile/personal/find_password')}}">忘记密码？</a></span>
                </div>
                <div class="sub"><input type="submit" value="立即绑定"></div>
                <div class="noPerson"><p>还不是个人会员? <a href="{{url("mobile/personal/regbinding?openid=$openid&unionid=$unionid&category=$category")}}">立即注册一个账号并绑定</a></p></div>
            </form>
        </div>
        {{--手机登录--}}
        @if(empty($formUrl))
            <div class="register_login mobLogin"  style="display: none" >
                <form action="{{url('mobile/personal/stroybindingwithmobile')}}" onsubmit="return checkMobile('#mobForm')" method="post" id="mobForm"  name="mobForm" >
                    {{csrf_field()}}
                    <input type="hidden" name="unionid" id="unionid" value="{{ $unionid }}">
                    <input type="hidden" name="openid" id="openid" value="{{ $openid }}">
                    <input type="hidden" name="category" id="category" value="{{ $category }}">

                    <ul>
                        <li><i class="icon_rl05"></i><input type="text" name="mobile" id="mobile" autocomplete="off"  placeholder="请输入手机号码"></li>
                        <li><i class="icon_rl07"></i><input type="text" name="mobCode" id="mobCode"  autocomplete="off"  placeholder="请输入验证码" class="inp02">
                            <input name="mobcode" id="mobcode" type="button" onclick="getModCode($(this),$('#mobile'))" class="code" value="获取验证码">
                    </ul>
                    <div class="forget">
                        <span class="forgetPass"><a>忘记密码？</a></span>
                    </div>
                    <div class="sub"><input type="submit" value="立即绑定"></div>
                    <div class="noPerson"><p>还不是个人会员? <a href="{{url("mobile/personal/regbinding?openid=$openid&unionid=$unionid&category=$category")}}">立即注册一个账号并绑定</a></p></div>
                </form>
            </div>
        @endif
    </div>

    {{--尾部--}}
    @include('default.mobile.layouts.footer')
@endsection

@section('footerjs')
    @parent
    <script type="text/javascript">
        var imgCode = "{{captcha_src('code')}}" + Math.random();
        var _token = "{{csrf_token()}}";
        @if(!empty(session('status')))
           layerMsg("{{ session('status') }}");
        @endif
        @if(count($errors)>0)
                @if(is_object($errors))
                @foreach($errors->all() as $error)
                    layerMsg("{{$error}}");
                @endforeach
                @else
                    layerMsg("{{$error}}");
                @endif
        @endif
    </script>
    <script type="text/javascript" src="{{asset('/default/js/mobile/personal/login.js')}}"></script>

@endsection